aboutsummaryrefslogtreecommitdiff
path: root/src/app/anime/[id]/[...animeId]
diff options
context:
space:
mode:
authorreal-zephex <[email protected]>2024-04-06 15:38:39 +0530
committerGitHub <[email protected]>2024-04-06 15:38:39 +0530
commit99e977342c2bc4aa3f6b930dfab80a7dc9f5eee3 (patch)
treee5ea8e64e27778ce468431138775bf9f6dc3874b /src/app/anime/[id]/[...animeId]
parentUI Upgrades for anime section. (diff)
parentadded search functionality (diff)
downloaddramalama-99e977342c2bc4aa3f6b930dfab80a7dc9f5eee3.tar.xz
dramalama-99e977342c2bc4aa3f6b930dfab80a7dc9f5eee3.zip
Merge pull request #2 from real-zephex/kdrama-section-rewrite
The kdrama section underwent a complete rewrite.
Diffstat (limited to 'src/app/anime/[id]/[...animeId]')
-rw-r--r--src/app/anime/[id]/[...animeId]/page.jsx13
-rw-r--r--src/app/anime/[id]/[...animeId]/video.module.css7
2 files changed, 12 insertions, 8 deletions
diff --git a/src/app/anime/[id]/[...animeId]/page.jsx b/src/app/anime/[id]/[...animeId]/page.jsx
index 966f212..950f618 100644
--- a/src/app/anime/[id]/[...animeId]/page.jsx
+++ b/src/app/anime/[id]/[...animeId]/page.jsx
@@ -10,6 +10,7 @@ import { redirect } from "next/navigation";
import Link from "next/link";
export default async function Video({ params }) {
+ let link;
const id = params.animeId[0];
const series = params.animeId[1];
@@ -25,7 +26,16 @@ export default async function Video({ params }) {
redirect("/404");
}
- const link = data.sources[4].url;
+ try {
+ link = data.sources[4].url;
+ } catch (error) {
+ try {
+ link = data.sources[3].url;
+ } catch (error) {
+ console.log("Episode not found.");
+ redirect("/404");
+ }
+ }
return (
<div className={styles.VideoMain}>
@@ -37,7 +47,6 @@ export default async function Video({ params }) {
<MediaPlayer
title={words}
src={link}
- playsInline
aspectRatio="16/9"
load="eager"
className={styles.VideoPlayer}
diff --git a/src/app/anime/[id]/[...animeId]/video.module.css b/src/app/anime/[id]/[...animeId]/video.module.css
index d947fc3..0214e60 100644
--- a/src/app/anime/[id]/[...animeId]/video.module.css
+++ b/src/app/anime/[id]/[...animeId]/video.module.css
@@ -1,8 +1,3 @@
-.VideoMain {
- max-width: 98%;
- margin: 0px auto;
-}
-
.Video {
display: flex;
justify-content: center;
@@ -11,7 +6,7 @@
.VideoPlayer {
border-radius: 10px;
- width: 75%;
+ width: 70%;
height: auto;
}